home *** CD-ROM | disk | FTP | other *** search
/ Network CD 2 / Network CD - Volume 2.iso / programs / internet / dnet / dshterm1_0.lha / lib / st / dlistops.s < prev    next >
Encoding:
Text File  |  1992-02-04  |  792 b   |  49 lines

  1. ; MORE STUFF NICKED FROM THE SUP32.LIBRARY (C) Matt Dillon
  2.  
  3.         xdef        _gethead
  4.         xdef        _getsucc
  5.         xdef        _nextnode
  6.         xdef        _gettail
  7.  
  8.         OPT        o+            ;optimize
  9.         OPT        l+            ;link
  10.  
  11. ; input A0, output d0
  12. _nextnode
  13. _gethead
  14. _getsucc
  15.         MOVEA.L     (A0),A0
  16.         TST.L       (A0)
  17.         BEQ.S       _gh_nogo
  18.         MOVE.L      A0,D0
  19.         RTS
  20. _gh_nogo
  21.         MOVEQ       #0,D0
  22.         RTS
  23.  
  24.  
  25. ; a0 input, d0 output
  26. _gettail:
  27.         move.l  8(A0),A1        ;A1 = lh_TailPred
  28.         move.l  A1,D0            ;D0 = result
  29.         cmp.l   A1,A0            ;is it pointing to lh_Head?
  30.         bne.s    _gt_nogo
  31.         moveq    #0,d0
  32. _gt_nogo
  33.         rts
  34.  
  35.  
  36. ; Original gettail as per sup32 lib but we shall use the above one I think
  37. ; input: A0, output d0
  38. ;_gettail
  39. ;        MOVEA.L     8(A0),A0
  40. ;        TST.L       4(A0)
  41. ;        BEQ.S       _gt_nogo
  42. ;        MOVE.L      A0,D0
  43. ;        RTS
  44. ;_gt_nogo
  45. ;        MOVEQ       #00,D0
  46. ;        RTS
  47.  
  48.  
  49.